import java.io.File;

public class GetFileInfo {

    public static void main(String[] args) {
        File file = new File("test.txt");
        System.out.println(file.getName());
        System.out.println(file.getAbsolutePath());
        System.out.println(file.getPath());
        System.out.println(file.getParent());
        System.out.println(file.length());
        System.out.println(file.exists());
        System.out.println(file.isDirectory());  
        System.out.println(file.isFile());  
    }
}